﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AgreementOpenExeForm
{
    public partial class Form1 : Form
    {
        string[] args;
        public Form1(string[] args)
        {
            this.args = args;
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (args.Length > 0)
            {
                string arg = args[0];
                string[] sarray = arg.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                string proPath = "";
                string address = "";
                sarray.ToList().ForEach(item =>
                {
                    if (item.IndexOf("copen://") != -1)
                    {
                        proPath = System.Web.HttpUtility.UrlDecode(item.Replace("copen://", ""));
                    }
                    else
                    {
                        //MessageBox.Show(item);
                        address = System.Web.HttpUtility.UrlDecode(item.Substring(0, item.Length - 1));
                    }
                });
                //MessageBox.Show(proPath, address);
            }
            Application.Exit();
        }
    }
}
